# Deploying a Contract Using Remix-IDE

Remix Project is a development tool that provides developers with the necessary technologies and features for the entire smart contract development process. It also serves as an educational platform for learning and experimenting with Ethereum.

{% hint style="info" %}
When deploying a contract on any blockchain, the native token of that chain must be used to pay for deployment gas fees. This applies to dKargo Chain as well. Before deploying on the dKargo testnet (Warehouse), developers can obtain $DKA testnet tokens via the faucet.\
\
Remix interacts with the blockchain using the wallet registered in [MetaMask](/docs2-eng/wallet-setup/creating-a-wallet.md).
{% endhint %}

## STEP 1 - Getting Started with Remix

1. Access [Remix](https://remix.ethereum.org/) and navigate to File Explorer, then click ≡ (menu icon). Select \[ + Create Blank ] to create a new Workspace.
2. Create a new file named <mark style="color:blue;">`counter.sol`</mark> and enter the contract code or use the provided sample code.

```solidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
 
contract Counter {
    uint256 public number;
 
    function setNumber(uint256 newNumber) public {
        number = newNumber;
    }
 
    function increment() public {
        number++;
    }
}
```

3. Go to the **\[ Solidity Compile ]** sidebar option and select <mark style="color:blue;">`counter.sol`</mark> to compile the contract.

## STEP 2 - Deploying the Contract

1. Navigate to the **\[ Deploy & Run Transactions ]** sidebar option.
2. Change the ENVIRONMENT dropdown to "Injected Provider - MetaMask".
3. In MetaMask, click **\[ Connect ]** to grant Remix access.

<figure><img src="/files/2Mk6VQr1c6Ev8wuKUZHY" alt="" width="563"><figcaption></figcaption></figure>

4. Once MetaMask is connected, click the **\[ Deploy ]** button to deploy the contract.

<figure><img src="/files/RzlayEjM8r9E4cTrRSLe" alt="" width="563"><figcaption></figcaption></figure>

5. The deployed contract can be verified in[ the Verified Contracts section of dScanner](https://warehouse.dscanner.io/contracts-verified).&#x20;

## STEP 3 - Interacting with the Contract

1. After deploying the contract, interaction is available in the bottom-left tab of Remix.

<figure><img src="/files/o2BAoJeSFVzdr9Vm0o95" alt="" width="563"><figcaption></figcaption></figure>

2. Click **\[ number ]** to retrieve the stored number in the contract. The default value after deployment is **0**.

<figure><img src="/files/8pAriL2y1181a8h4hfk0" alt="" width="279"><figcaption></figcaption></figure>

3. Click **\[ increment ]** to send a transaction that increases the number by +1. Confirm the transaction in MetaMask, which will then be sent to the dKargo Chain.

<figure><img src="/files/Y5HM02EP8ZLyRGfHKvIm" alt="" width="563"><figcaption></figcaption></figure>

4. Click **\[ number ]** again to verify that the stored number has increased by **1**.

<figure><img src="/files/vw08jJrZQINkIVqhU861" alt="" width="280"><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.dkargo.io/docs2-eng/deploy-contract/deploying-a-contract-using-remix-ide.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
